//
//  OTCameraCapture.h
//  OldTime
//
//  Created by 茶 on 2023/10/25.
//

#import <Foundation/Foundation.h>
#import "CACameraUtil.h"
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class CACameraCapture;
@protocol OTCameraBufferDelegate <NSObject>

- (void)camera:(CACameraCapture *)camera processFrame:(CVPixelBufferRef)pixelBuffer;

@end

@interface CACameraCapture : NSObject

- (instancetype)initCamera;

@property (nonatomic, weak) id<OTCameraBufferDelegate>delegate;
@property (nonatomic, copy) dispatch_block_t successBlock;
@property (nonatomic, copy) dispatch_queue_t queue;
@property (nonatomic, assign) BOOL isFront;

- (void)startRunning;

- (void)stopRunning;

- (UIImage *)takePhoto;

@end

NS_ASSUME_NONNULL_END
